/*
 * Lucas McDaniel
 * GSoC '11
 * HoneyViz
 * 
 * This basic class sets the color next to the event name
 * or location name in ColorChooserPopup.java
 * 
 * Should be static with resize
 */

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import javax.swing.Icon;

public class ColorIcon implements Icon {
    
    private Color color;
    
    public ColorIcon(Color color)
    {
        this.color = color;
    }
    
    public int getIconHeight()
    {
        return 15;
    }
    
    public int getIconWidth()
    {
        return 15;
    }
    
    public void paintIcon(Component c, Graphics g, int x, int y)
    {
        g.setColor(color);
        g.fillRect(2, 2, 12, 12);
    }
}
